package ar.com.nexoweb.actualidadbasquet;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.webkit.WebView;
import android.widget.TextView;
import ar.com.nexoweb.actualidadbasquet.entities.Noticia;

public class InfoligaActivity extends Activity {

	TextView txtTitulo;
	WebView txtContenido;
	Noticia noticia;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_infoliga);

		txtTitulo = (TextView) findViewById(R.id.txtTitulo);
		txtContenido = (WebView) findViewById(R.id.txtContenido);

		if (getIntent().hasExtra("noticia")) {
			noticia = (Noticia) getIntent().getSerializableExtra("noticia");

			txtTitulo.setText(noticia.getTitle());
			txtContenido.loadDataWithBaseURL(null, noticia.getTitle(), "text/html", "UTF-8", null);
			
			String contenidolimpio = noticia.getDescription();
			contenidolimpio.replace("-- Delivered by Feed43 service", "");
			txtContenido.loadDataWithBaseURL(null, contenidolimpio, "text/html", "UTF-8", null);
		}
	}

	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.rss_reader, menu);
		return true;
	}

}
